<?php
	require_once('paths.inc');
	require_once(INCLUDE_PATH.'constants.inc');
	require_once('page.inc');
	require_once(DB_PATH.'db.inc');
	
	require_once('security.inc');
	require_once('utils.inc');	
	require_once('time.inc');
    
    require_once(INCLUDE_PATH . 'classes/cipher_blowfish.php');
			
	session_start();
	check_permissions(null, "servicii.php");
	checkIsLoggedIn();
	
	html_header("LANG_Servicii", null, "servicii");
	
	$id_client = $_SESSION['user_logat']->id_client;	
	
    $linkuri = array(LANG_Home => "home.php", LANG_Servicii => "");	
	titlu_pagina($linkuri);
	output_notice_msg();
	output_error_msg();
    output_extra_text(LANG_EXTRA_SERVICI);
    		
	$cod = '<form name="autentificare" action="http://www.onlinelogistics.eu/authenticate.php" method="post">
	<table border="0" cellpadding="2" cellspacing="2">
		<tr>
			<td align="center" colspan="2">Autentificare OnlineLogistics</td>
		</tr>
		<tr>
			<td align="right">Utilizator</td>
			<td><input type="text" value="" name="formUsername" /></td>
		</tr>
		<tr>
			<td align="right">Parola</td>
			<td><input type="password" value="" name="formPassword" /></td>
		</tr>		
		<tr>
			<td></td>
			<td><input type="submit" value="Autentificare" name="login" /></td>
		</tr>
	</table>
</form>';
?>
	<div class="container" align="left">	
		<div style="font-size: 16px; font-weight: bold"><?php echo LANG_Descriere_servicii; ?></div>
		<table align="left" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td>
					<textarea rows="18" cols="100"><?php echo htmlspecialchars($cod); ?></textarea>
				</td>
			</tr>
		</table>
	
	    <?php    
	        $coder = new Horde_Cipher_blowfish();
	        $coder->setKey("scumpascumpelor");
	        
	        $id_clientReadyForCoding = substr(($id_client . "                             "), 0, 8);
	        $id_clientCoded = urlencode($coder->encryptBlock($id_clientReadyForCoding));
	        
	        $text_tracker = '<div>
    <script type="text/javascript" src="http://www.onlinelogistics.eu/include/javascript/web_service_interface.js"></script>
    <link rel="stylesheet" rev="stylesheet" href="http://www.onlinelogistics.eu/include/css/comanda_service.css" type="text/css" media="screen" charset="utf-8" />
    <input type="text" id="nr_referinta" value="" />
    <input type="text" id="identity" value="' . $id_clientCoded . '">
    <input type="button" value="Cauta" onclick="make_request()" />
    <div id="response"></div>
</div>';
	    ?>
	    <br />
	    </div>
	    <div class="container" align="left">
	    <div style="font-size: 16px; font-weight: bold"><?php echo LANG_Descriere_servicii_status_comanda; ?></div>
		<table align="left">    		
	        <tr>
	        	<td>
	            Pentru folosirea tracker-ului de comenzi introduceti in codul paginii HTML urmatorul cod; el va va permite pe baza numarului<br>
	            de referinta a comenzii sa aflati statusul comenzii respective, precum si stadiul in care se afla comanda in ceea ce priveste<br>
	            locurile de incarcare si descarcare a marfii transportate.
	        	</td>
	        <tr>
	        <tr>
	        	<td>        
	            	<textarea cols="170" rows="8"><?php echo $text_tracker ?></textarea>
	            </td>
	        </tr>
	    </table>
	</div>
<?php
	html_footer();
?>